/*
* Copyright (C) 2012  lidp.
*
* Contact: lidp <openser@yeah.org>
*	
* This file is part of Open Source Peasant Framework.
*
* Peasant is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*	
* You should have received a copy of the GNU General Public License
* along with Peasant.
*
*/

/**@file pst_common.h
  * common utils used by all files
  *
  *@author lidp <openser@yeah.org>
  */

  #ifndef __PEASANT_COMMON_H__
  #define __PEASANT_COMMON_H__


/**@def pst_true
* True (1).
*/
/**@def pst_false
* False (0).
*/

#define pst_ture   1
#define pst_false  0


/**@def pst_bool_t
* pst_bool_t.
*/
typedef int pst_bool;
#define pst_bool_t pst_bool

#define PST_MAX(a,b) (((a) > (b)) ? (a) : (b))
#define PST_MIN(a,b) (((a) < (b)) ? (a) : (b))
#define PST_ABS(a)   (((a) < 0) ? -(a) : (a))

/* NULL pointor */
#ifdef NULL
#define PST_NULL   NULL
#else 
#define PST_NULL   0

typedef unsigned int pst_ssize_t;
typedef int pst_size_t;


#endif
